/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.example.demo.common;

import lombok.Data;



/**
 *
 * @author Administrator
 */
@Data
public class ApiResponse<T> {
    
    private static final Integer SUCCESS_CODE  = 200;
    private Integer code;
    private T data;
    
    public static  <T>ApiResponse<T>  success(T data){
        ApiResponse apiResponse = new ApiResponse();
        apiResponse.setData(data);
        apiResponse.setCode(SUCCESS_CODE);
        return apiResponse;
    }
    
}
